package ${(projectConfig.projectPackageName)!}.common.security;

import org.springframework.security.web.authentication.WebAuthenticationDetails;

import javax.servlet.http.HttpServletRequest;

public class CustomWebAuthenticationDetails extends WebAuthenticationDetails {
    private static final long serialVersionUID = 1L;
    <#if "${(dependencies.weixin)!}" != "">private final String wxCode;</#if>

    public CustomWebAuthenticationDetails(HttpServletRequest request) {
        super(request);
        <#if "${(dependencies.weixin)!}" != "">wxCode = request.getParameter("wxCode");</#if>
    }

    <#if "${(dependencies.weixin)!}" != "">
    public String getWxCode() {
        return wxCode;
    }
    </#if>

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(super.toString())<#if "${(dependencies.weixin)!}" != "">.append("; wxCode: ").append(this.getWxCode())</#if>;
        return sb.toString();
    }
}
